<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
		
		document.write("<table>")
			for (var i = 9; i >=1; i--) {
				document.write("<tr>");
					for (var j = 1; j <=i; j++) {
						if(j%2==1){
							document.write("<td style='background:red'>"+j+"*"+i+"="+i*j+"</td>");
						}else if(i%2==1){
							document.write("<td style='background:blue'>"+j+"*"+i+"="+i*j+"</td>");
						}else{
							document.write("<td style='background:gray'>"+j+"*"+i+"="+i*j+"</td>");
						}
					}
				document.write("</tr>");
			}
		document.write("</table>")
	</script>
</head>
<body>
	
</body>
</html>